Crate leptos_macro

source ·

Macros§

  • Generates a slice into a struct with a default getter and setter.
  • An optimized, cached template for client-side rendering. Follows the same syntax as the view! macro. In hydration or server-side rendering mode, behaves exactly as the view macro. In client-side rendering mode, uses a <template> node to efficiently render the element. Should only be used with a single root element.
  • The view macro uses RSX (like JSX, but Rust!) It follows most of the same rules as HTML, with the following differences:

Attribute Macros§

  • Annotates a function so that it can be used with your template as a Leptos <Component/>.
  • Defines a component as an interactive island when you are using the experimental-islands feature of Leptos. Apart from the macro name, the API is the same as the component macro.
  • Declares that a function is a server function. This means that its body will only run on the server, i.e., when the ssr feature on this crate is enabled.
  • Annotates a struct so that it can be used with your Component as a slot.

Derive Macros§

  • Derives a trait that parses a map of string keys and values into a typed data structure, e.g., for route params.